<template>
  <div class="enterprise-setting-view">
    <overall v-if="isShow" :globalSettingParam="globalSettingParam"></overall>
    <AccountLoginSettings v-if="isShow" :globalSettingParam="globalSettingParam"/>
    <pcLogin v-if="isShow" :pcLoginPageSettingParam="pcLoginPageSettingParam"></pcLogin>
    <mobile v-if="isShow" :appSettingParam="appSettingParam"></mobile>
  </div>
</template>
  
<script>
import overall from './components/overall.vue';
import mobile from './components/mobile.vue';
import pcLogin from './components/pcLogin.vue';
import AccountLoginSettings from '@src/modules/setting/common/enterprise/components/AccountLoginSettings.vue'
import { getRootWindow } from '@src/util/dom';
import { getSettingInfo } from './api';

export default {
  name: 'enterprise-setting',
  data() {
    return {
      globalSettingParam: {},
      appSettingParam: {},
      pcLoginPageSettingParam: {},
      isShow: false,
    }
  },
  created() {
    getSettingInfo({ tenantId: JSON.parse(getRootWindow(window)._init).user.tenantId }).then(res => {
      if (res.status == 0) {
        this.globalSettingParam = res.data?.settingPageParam?.globalSettingParam;
        this.appSettingParam = res.data?.settingPageParam?.appSettingParam;
        this.pcLoginPageSettingParam = res.data?.settingPageParam?.pcLoginPageSettingParam;
      } else {
        this.$message.error(res.message);
      }
      this.isShow = true;
    })
  },
  components: {
    overall,
    mobile,
    pcLogin,
    AccountLoginSettings
  },
}
</script>
  
<style lang="scss" scoped>
.enterprise-setting-view {
  width: 100%;
  padding: 12px;
  height: 100vh;
  overflow: auto;
}
</style>